/** 
 * \file util.h
 * \author Ameen Jaber
 * \author Mohamad Noureddine
 * \author Mohamed Sabra
 * \brief Utility defintions
 */ 
#ifndef UTIL_H_
#define UTIL_H_

#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/unordered_map.hpp>
#include <map>
#include <string>
#include <iostream>

/**
 * An enum definiton of the operators and types that 
 * the TripleP grammar supports.
 */
enum TP_Op{ // TripleP Operators and Types
	root,                                       // root node
	Constant,                                   // constant number 
	Integer,                                    // integer32 type
	Sequence,                                   // sequence of type 
	Set,                                        // set of type
	Relation,                                   // relation from type to type
	Function,                                   // function from type to type
	Graph,                                      // graph structure definition
	Tree,                                       // tree structure definition
    Algorithm,                                  // algorithm
	Custom,                                     // custom type definition
	Plus,                                       // addition
	Minus,                                      // Subtraction
	Multiply,                                   // *
	Divide,                                     // / 
	Modulo,                                     // % 
	Exponent,                                   // ^
	uPlus,                                      // u+
	uMinus,                                     // u-
	uNot,                                       // u~
	Access,                                     // at
	Assignment,                                 // =
	GreaterThan,                                // >
	LessThan,                                   // <
	GreaterThanEqual,                           // >=
	LessThanEqual,                              // <=
	And,                                        // and
	Or,                                         // or
	Equal,                                      // ==
	For,                                        // for
	If,                                         // if
	Then,                                       // then
	Else,                                       // else
	While,                                      // while 
	sNot,                                       // set unary not
	Union,                                      // set union
	Intersection,                               // set intersection
	Cardinality                                 // cardinality
};

enum Alg_Op {
    Gbfs,                                       // BFS for graphs
    Gmst                                        // MST for graph
}; 

typedef enum TP_Op TP_Op_t;

typedef enum Alg_Op Alg_Op_t;

/**
 * A structure defining the node in the TripleP Graph
 */
struct TPNode {
	TP_Op_t op; // the node's TripleP operator 
	int value; // the value that node contains if any
};

/**
 * A structure defining the edge in the TripleP Graph
 */
struct TPEdge {
	int label; // define the order of the edge
};

enum TState {
  Create,  //!< The task is newly created
  Idle,    //!< The task is idle and has nothing to do 
  Working, //!< The task is in progress
  Done     //!< The task is done
};

typedef enum TState TState_t;

typedef std::vector<TState_t *> st_vector_t; // vector of state pointer to keep track of child tasks

#endif
